"use strict";
const common_vendor = require("../../../common/vendor.js");
const api_police_clock = require("../../../api/police/clock.js");
const stores_userInfo = require("../../../stores/userInfo.js");
if (!Array) {
  const _easycom_up_list_item2 = common_vendor.resolveComponent("up-list-item");
  const _easycom_up_empty2 = common_vendor.resolveComponent("up-empty");
  const _easycom_up_gap2 = common_vendor.resolveComponent("up-gap");
  const _easycom_up_list2 = common_vendor.resolveComponent("up-list");
  (_easycom_up_list_item2 + _easycom_up_empty2 + _easycom_up_gap2 + _easycom_up_list2)();
}
const _easycom_up_list_item = () => "../../../node-modules/uview-plus/components/u-list-item/u-list-item.js";
const _easycom_up_empty = () => "../../../node-modules/uview-plus/components/u-empty/u-empty.js";
const _easycom_up_gap = () => "../../../node-modules/uview-plus/components/u-gap/u-gap.js";
const _easycom_up_list = () => "../../../node-modules/uview-plus/components/u-list/u-list.js";
if (!Math) {
  (_easycom_up_list_item + _easycom_up_empty + _easycom_up_gap + _easycom_up_list)();
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  __name: "clockInfo",
  setup(__props) {
    stores_userInfo.useUserInfoStore();
    const uToastRef = common_vendor.ref(null);
    const data = common_vendor.reactive({
      queryParam: {
        pageNum: 1,
        pageSize: 10,
        month: void 0,
        policeUserId: void 0
      },
      list: [],
      total: 0
    });
    const { queryParam, list, total } = common_vendor.toRefs(data);
    common_vendor.onLoad((options) => {
      if (options && options.time && options.userId) {
        queryParam.value.month = options.time;
        queryParam.value.policeUserId = options.userId;
        getList();
      }
    });
    const scrolltolower = () => {
      getList();
    };
    const getList = () => {
      common_vendor.index.showLoading({
        title: "加载中",
        mask: true
      });
      api_police_clock.listClock(queryParam.value).then((res) => {
        common_vendor.index.hideLoading();
        const { data: data2 } = res;
        list.value = data2.records;
        total.value = data2.total;
      }).catch((err) => {
        common_vendor.index.hideLoading();
        uToastRef.value.show({
          type: "error",
          message: err
        });
      });
    };
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: common_vendor.unref(list).length
      }, common_vendor.unref(list).length ? {
        b: common_vendor.f(common_vendor.unref(list), (item, index, i0) => {
          return {
            a: common_vendor.t(common_vendor.unref(common_vendor.dayjs)(item.clockTime).format("YYYY-MM-DD hh:mm:ss")),
            b: common_vendor.t(item.clockAddress),
            c: index,
            d: "3bf6d3e8-1-" + i0 + ",3bf6d3e8-0"
          };
        })
      } : {
        c: common_vendor.p({
          mode: "data",
          text: "暂无记录",
          icon: "http://cdn.uviewui.com/uview/empty/data.png"
        })
      }, {
        d: common_vendor.p({
          height: "10"
        }),
        e: common_vendor.o(scrolltolower),
        f: common_vendor.p({
          height: "100vh"
        })
      });
    };
  }
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-3bf6d3e8"]]);
wx.createPage(MiniProgramPage);
